fix: Support negation patterns when including/excluding files from ZIP files#1517
fix: Support negation patterns when including/excluding files from ZIP files#1517aklinker1 merged 10 commits intowxt-dev:mainfrom
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Do I need to add some test cases for these fix? |
aklinker1
left a comment
There was a problem hiding this comment.
Thanks for the PR! We need to add some tests around these changes:
https://github.com/wxt-dev/wxt/blob/main/packages/wxt/e2e/tests/zip.test.ts
…o fix/zip-exclude-bang
packages/wxt-demo/wxt.config.ts
Outdated
| exclude: [ | ||
| '**/*.json', // Exclude all .json files | ||
| '!manifest.json', // Include manifest.json | ||
| ], |
There was a problem hiding this comment.
Hold on, I'm looking at this code now, and based on the old logic:
options?.include?.some((pattern) => minimatch(relativePath, pattern)) || !options?.exclude?.some((pattern) => minimatch(relativePath, pattern))Couldn't you have just added mainfest.json to include, since include has priority over exclude?
There was a problem hiding this comment.
Yeah, but original issue was to include this negate feature in exclude parameter. Maybe you can explain this to @skube.
There was a problem hiding this comment.
Perhaps I'm not understanding something, but I don't see an include option under the zip property.
There was a problem hiding this comment.
Oh yeah, there isn't.
@aklinker1 that options.includes you're mentioning is taking includeSources
that is different option.

There was a problem hiding this comment.
I've added a test case.
|
Sorry for the slowness, I got caught up in responding to new PRs and issues, so I lost track of this one. We'll get this merged and released now! Gonna merge with main, checks aren't running how they should be... |
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1517 +/- ##
==========================================
+ Coverage 80.98% 81.14% +0.15%
==========================================
Files 129 130 +1
Lines 6627 6649 +22
Branches 1080 1090 +10
==========================================
+ Hits 5367 5395 +28
+ Misses 1249 1243 -6
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
One more change, I'm gonna extract this to a function and use it for both |
|
Thanks for helping make WXT better! |
Overview
This is issue reproduction repo: https://github.com/skube/min-repro-wxt
Here is the discussion about creating this PR and more context.
#1510 (comment)
This PR closes #1510
Edit from @aklinker1: You can now do things like this when zipping the extension and source code: